home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 2
/
Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso
/
Aminet
/
dev
/
cross
/
sasmv14.dms
/
sasmv14.adf
/
examples
/
recmacro.s
< prev
next >
Wrap
Text File
|
1993-05-22
|
673b
|
33 lines
*************************************************
**
** This MACRO will calculate the FAKULTÄT of arg
** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
** (dont know the english word for this german
** goodie)
**
** © 1993 by FWS - SASM
**
*************************************************
heap O=128
arg set 12 ;thats the input
result set 1
fak macro
if \1#1
result set result*\1
\1 set \1-1
fak \1 ;recursive descent...
endc
endm
fak arg ;the parameter of fak is a set symbol!
.say The result is:
exp= result
;by the way: arg=12 is the maximum input, anything higher
;will cause the 32bit signed math routines of SASM to over-
;flow... too bad... :)